
 /*
  * Team Java
  * This is a scheduler.h file.
  * Author(s): Michael Satran Jr, Michael Pogson, Stephen Hunter
  * Date: 5/31/2012
  */


#ifndef SCHEDULER_H_INCLUDED
#define SCHEDULER_H_INCLUDED
 
#define MAX_PCB 32;
#define MAX_QUEUE 10;
 
 //Thread pool
 pthread_t threads[32];
 
 //Ready Queue for PCB's
 typedef struct pcb_queue_node
 {
	PCB *data;
	struct pcb_queue_node * prev;
	struct pcb_queue_node * next;
 } Node;
 
 //Ready queue pointers
 Node *rq_head;
 Node *rq_tail;
 
 //Blocked queue pointers
 Node *bq_head;
 Node *bq_tail;
 
 //pthread_t process_threads[MAX_QUEUE];
 
 int list_index;
 PCB process_list[32];
 
 /*Prototypes*/
 void addProcess(Process*);
 int enque(Node**, Node**, PCB*);
 PCB* deque(Node**, Node**);
 void testQueue();
 void printProcessList();
 void printQueue(Node**, Node**);
 void initQueue();
 void dequeAndPrint();
 void* runNextProcess();
 void testProcess();
 void do_request(PCB *pcb, Request r);
 void* process_func(void*);
 void interuptHandler(int);
 void *startScheduler();
 
 #endif